package com.xyoto.community.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.xyoto.community.constant.LoveStatus;
import com.xyoto.community.po.UserTitlePO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 动态评论回复列表VO
 */
@Data
@ApiModel("动态评论回复列表VO")
public class DynamicCommentReplyVo {
    @ApiModelProperty("回复id")
    Integer replyId;

    @ApiModelProperty("用户id")
    Integer userId;

    @ApiModelProperty("用户头像")
    String avatarUrl;

    @ApiModelProperty("昵称")
    String nickname;

    @ApiModelProperty("创建时间")
    Date createTime;

    @ApiModelProperty("点赞数目")
    Integer loveCount;

    @ApiModelProperty("用户点赞状态")
    Short loveStatus;

    @ApiModelProperty("回复内容")
    String content;

    @ApiModelProperty("回复目标用户信息")
    @JsonProperty("targetUser")
    TargetReplyUserVO targetReplyUserVO;

    @ApiModelProperty("头衔")
    @JsonProperty("userTitle")
    private UserTitlePO userTitlePO;


    public DynamicCommentReplyVo() {
        loveStatus = 1;
        loveCount = 0;
    }

    public DynamicCommentReplyVo(Integer replyId, Integer userId, Date createTime, Integer loveCount, Short loveStatus, String content) {
        this.replyId = replyId;
        this.userId = userId;
        this.createTime = createTime;
        this.loveCount = loveCount == null ? 0 : loveCount;
        this.loveStatus = loveStatus == null ? LoveStatus.UN_LOVE : loveStatus;
        this.content = content;
        this.avatarUrl = "";
        this.nickname = "";
    }
}
